# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

# This file was taken in modified form from AUR
# AUR Maintainer: Felix Yan <felixonmars@archlinux.org>
# AUR Contributor: Crass00 <crass00 @ hotmail . com>

pkgname=python2-backports.entry-points-selectable
_pkgname=backports.entry_points_selectable
pkgver=66.d4b54f4
_pyver=2.7
pkgrel=2
pkgdesc='Compatibility shim providing selectable entry points for older implementations.'
arch=('any')
url='https://github.com/jaraco/backports.entry_points_selectable'
license=('MIT')
depends=('python2-backports' 'python2-pluggy' 'python2-funcsigs')
makedepends=('python2-setuptools' 'git')
source=("git+https://github.com/jaraco/$_pkgname.git")
sha512sums=('SKIP')

prepare() {
  cd $_pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

build() {
  cd $_pkgname

  python2 setup.py build
}

package() {
  cd $_pkgname

  python2 setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build

  install -Dm 644 -t "$pkgdir/usr/share/licenses/$pkgname/" LICENSE

  rm "$pkgdir/usr/lib/python$_pyver/site-packages/backports/__init__.py"*
}

